package engine;

import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;

public class Circle extends PhysicsObject{
	private double radius;
	
	public Circle(double x, double y, double radius){
		this.radius = radius;
		this.centroid = new Vector(x, y);
		this.velocity = new Vector();
		w = r = 0;
	}

	@Override
	public Rectangle2D getBoundingBox() {
		return new Rectangle((int) (centroid.getX() - radius), (int) (centroid.getY() - radius),
				(int) (radius * 2 + 1), (int) (radius * 2 + 1));
	}

	@Override
	public ArrayList<Vector> getCollisionPoints() {
		ArrayList<Vector> points = new ArrayList<Vector>();
		for (int i = 0; i < Math.PI * radius / 180; i++){
			points.add(new Vector(Math.cos(i), Math.sin(i)).add(centroid));
		}
		// TODO Auto-generated method stub
		return points;
	}

	@Override
	public Vector pointInObject(Vector p) {
		return p.length() <= radius ? p.normalize().scale(radius - p.length()) : null;
	}

	@Override
	public Vector respondToForce(Vector velocity, Vector position, double m) {
		// TODO Auto-generated method stub
		return null;
	}
}
